package logic

import (
	"GoWeb_Advanced/00_bluebell/dao/redis"
	"GoWeb_Advanced/00_bluebell/models"
	"strconv"

	"go.uber.org/zap"
)

// VoteForPost 为贴子投票的函数
func VoteForPost(userID int64, data *models.ParamVoteData) error {
	zap.L().Debug("VoteForPost",
		zap.Int64("userID", userID),
		zap.String("postID", data.PostID),
		zap.Int8("direction", data.Direction))
	return redis.VoteForPost(strconv.Itoa(int(userID)), data.PostID, float64(data.Direction))
}
